
//FOR REGIONAL STUDY


//start by loading RegionClean.csv

//encode factor variables
encode dep2, gen(dep_enc)
encode region, gen(reg_enc)



// TABLE 1 - DESCRIPTIVE STATISTICS

eststo clear 
estpost tabstat psm job_sect pub_avg priv_avg male rel_pubsect religion risk_averse1 gpa family_inc, statistics(mean sd min max count) columns(statistics)
esttab, cells("mean(fmt(2)) sd(fmt(2)) min(fmt(0)) max(fmt(0)) count(fmt(0))") nostar unstack nonote nomtitle nonumber replace label fragment




//TABLE 2  
//career preferences regressed on psm


global controls_region male risk_averse1 rel_pubsect religion gpa family_inc i.class_yr i.dep_enc ib3.reg_enc 


eststo clear
foreach var in job_sect pub_avg priv_avg {  
   reg `var' psm $controls_region, robust
   estimates store `var'_region
   }
   
   
esttab job_sect_region pub_avg_region priv_avg_region using psm.tex,  ///
se(3) b(3) r2 nogaps star($^{\dagger}$ 0.10 $^{*}$ 0.05 $^{**}$ 0.01 $^{***}$ 0.001) compress unstack replace label ///
nonumbers starlevels($^{\dagger}$ 0.10 $^{*}$ 0.05 $^{**}$ 0.01 $^{***}$ 0.001)  mtitles( "Public Sector Preference" "Public Sector Index" "Private Sector Index")  /// 
drop (*.class_yr) 
